package br.com.duosoftware.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 *
 * @author daniel
 * 
 */
public class HibernateUtil {
   
    private static final SessionFactory SESSION_FACTORY;
    
    static{
    
        SESSION_FACTORY = new Configuration()
                               .configure("br/com/duo/loterica/hibernate/hibernate.cfg.xml")
                               .buildSessionFactory();
        
    }
    
    public static Session getSession(){
    
        return SESSION_FACTORY.openSession();
        
    }
    
}
